home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
KEYBOARD
/
XMOUSE11.ARJ
/
XMDEMO.C
< prev
next >
Wrap
Text File
|
1992-05-07
|
2KB
|
74 lines
#include "xlib.h"
#include "xmouse.h"
#include <dos.h>
unsigned char i, count = 1;
main()
{
setmodex();
xbar(0,0,320,240,0,130);
xputpix(190,90,0,10);
xbar(100,100,200,200,0,145);
xline(40,40,150,150,0,red);
chargen(10,20,'T',0,red);
textxy(18,20,"his is a test of the xlib and xmouse",50,page0,black);
textxy(120,30,"routines.",9,black,page0);
textxy(56,40,"Watch square change color.....",50,page0,black);
for(i = 0; i < 64; ++i)
{
chgcolor(145,i,i,i);
delay(60);
};
textxy(10,210,"Press the left mouse button to change",50,page0,red);
textxy(100,220,"the cursor.",11,page0,red);
textxy(50,230,"Press the right button to exit.",31,page0,red);
if (!minitialize(50,150,lightgray))
{
settext();
printf("Mouse is not installed. Terminating. \n");
exit(0);
};
mshowcursor();
while (!mrightpressed())
{
if (mleftpressed())
{
switch (count) {
case 0 : setcursshape(Standard);
count++;
break;
case 1 : setcursshape(UpArrow);
count++;
break;
case 2 : setcursshape(LeftArrow);
count++;
break;
case 3 : setcursshape(CheckMark);
count++;
break;
case 4 : setcursshape(PointingHand);
count++;
break;
case 5 : setcursshape(DiagonalCross);
count++;
break;
case 6 : setcursshape(RectangularCross);
count++;
break;
case 7 : setcursshape(HourGlass);
count = 0;
break;
}
}
}
mhidecursor();
muninitialize();
settext();
}